package com.sskj.bibi.presenter;

import com.sskj.bibi.ui.fragment.BibiMainFragment;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.CoinBean;
import com.sskj.lib.http.CallBackOption;

import java.util.List;


public class BibiMainFragmentPresenter extends BasePresenter<BibiMainFragment> {


    public void getProduct(String code) {
        httpService.getProduct(null,code)
                .execute(new CallBackOption<HttpData<List<CoinBean>>>() {
                }.unLoadBind(mView)
                .execute(httpData->{
                    if (httpData.getData() != null && httpData.getData().size() > 0) {
                        mView.updateTitle(httpData.getData().get(0));
                    }
                }));
    }
}
